<template>
  <!--删除职位-->
  <d-Modal :show.sync="showDelete" width='300px'>
    <span slot="header">Delete</span>
    <div v-if = "deleteOption" slot="body" style="text-align:center;color:#333;padding:30px 0;font-size: 18px;">
      {{deleteOption.text}}
    </div>
    <div class="btn_group" slot="footer">
      <button v-touch-ripple class="greyBtn" @click="deleteItem">Confirm</button>
      <button v-touch-ripple class="activeBtn" @click="showDelete = false">Cancel</button>
    </div>
  </d-Modal>
</template>
<style rel="stylesheet/scss" type="text/css" lang="scss" scoped>
  @import "../../assets/css/variable";
</style>
<script>
  import dModal from './Modal'
  import {del} from '../../store/action'
    export default{
        components:{
          dModal
        },
        ready:function () {

        },
        data:function () {
          return{

          }
        },
        methods: {
          deleteItem:function (e) {
            var t = this;
            var param ={
              infoSetId:t.deleteOption.infoSetId,
              uuidLists:t.deleteOption.uuidLists,
              navigationCondition:t.deleteOption.navigationCondition,
              editCondition:t.deleteOption.editCondition
            }
            t.del(param,function(data){
                t.showDelete = false;
                t.$Notification.success('delete Success','', 2000);
                t.deleteOption.okFun();
            },function(data){
               t.showDelete = false;
               t.$Notification.warning(data,'', 2000);
            });
          }
        },
        vuex:{
          actions:{
            del
          }
        },
        props:{
          deleteOption:{
            type:Object,
            default:{
              text:'Delete these ?',
              infoSetId:'',
              okFun:function(){
              },
              cancelFun:function(){
              },
              uuidLists:[],
              navigationCondition:{},
              editCondition:{}
            }
          },
          showDelete:{
            type:Boolean,
          }
        }
    }
</script>
